package response;

import core.Constants;
import core.GamePacket;

import java.io.IOException;

/**
 * Response to grant the log out of the user
 *
 * @author yiyi, genki, Gary
 */
public class ResponseLogout extends GameResponse {

    private short status;

    public ResponseLogout() {
        code = Constants.SMSG_DISCONNECT;
    }

    public void setStatus(short status) {
        this.status = status;
    }

    @Override
    public byte[] createResponse() {
        GamePacket packet = new GamePacket(code);
        packet.addUint16(status);
        return packet.getBytes();
    }
}

